package com.mvc.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mvc.anno.SelfAutowrited;
import com.mvc.anno.SelfController;
import com.mvc.anno.SelfRequestMappping;
import com.mvc.service.UserService;

@SelfController
@SelfRequestMappping("/mvc")
public class MvxController {

	/*@SelfAutowrited("userService")
	UserService u;*/
	
	@SelfRequestMappping("/hello")
	public void hello(HttpServletRequest req, HttpServletResponse resp ) {
		String name = req.getParameter("name");
		String age = req.getParameter("age");
		try {
			PrintWriter writer = resp.getWriter();
			writer.write("{age:"+age+",name:"+name+"}");
			writer.flush();
			writer.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
	}
	
}
